package o;

import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;

public class bsv {
    public static int ˎ() {
        try {
            return ContentManager.getInstant().getContext().getPackageManager().getPackageInfo(ContentManager.getInstant().getContext().getPackageName(), DnsConfig.MAX_CACHE_ENTRIES).versionCode;
        } catch (Throwable e) {
            bqx.ˊ("ForumUtils", "getVersionCode error.", e);
            return 0;
        }
    }

    public static String ˋ() {
        try {
            return ContentManager.getInstant().getContext().getPackageManager().getPackageInfo(ContentManager.getInstant().getContext().getPackageName(), DnsConfig.MAX_CACHE_ENTRIES).versionName;
        } catch (Throwable e) {
            bqx.ˊ("ForumUtils", "getVersionCode error.", e);
            return "";
        }
    }

    public static bqv ॱ(final String str) {
        if (bqv.ˎ.ˎ().equals(str)) {
            return bqv.ˎ;
        }
        if (bqv.ॱ.ˎ().equals(str)) {
            return bqv.ॱ;
        }
        if (bqv.ˊ.ˎ().equals(str)) {
            return bqv.ˊ;
        }
        if (bqv.ˋ.ˎ().equals(str)) {
            return bqv.ˋ;
        }
        if (bqv.ˏ.ˎ().equals(str)) {
            return bqv.ˏ;
        }
        return new bqv() {
            public String ˎ() {
                return str == null ? bqy.ˋ().ˎ() : str;
            }
        };
    }

    public static int ॱ(String str, int i) {
        try {
            i = Integer.parseInt(str);
        } catch (NumberFormatException e) {
        }
        return i;
    }
}
